package com.mathdroid.gui.main.advertising;

import java.net.URI;

import javax.swing.ImageIcon;

/**
 * This contains information about an advertising.
 */
public final class Ad {

	/**
	 * The duration in seconds until the next advertising is shown.
	 */
	private int seconds = 0;
	
	/**
	 * The image of the advertising.
	 */
	private ImageIcon image = null;
	
	/**
	 * The URL to the website.
	 */
	private URI uri = null;
	
	/**
	 * Create a new advertising.
	 * @param sec Duration in seconds.
	 * @param img ImageIcon.
	 * @param url URL to website.
	 */
	public Ad(final int sec, final ImageIcon img, final String url) {
		this.seconds = sec;
		this.image = img;
		this.uri = java.net.URI.create(url);
	}

	/**
	 * @return the seconds
	 */
	public int getSeconds() {
		return seconds;
	}

	/**
	 * @return the image
	 */
	public ImageIcon getImage() {
		return image;
	}

	/**
	 * @return the uri
	 */
	public URI getUri() {
		return uri;
	}
}
